home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / u_man / cat3 / Tcl / getint.z / getint
Encoding:
Text File  |  1998-10-30  |  5.1 KB  |  133 lines

  1.  
  2.  
  3.  
  4. TTTTccccllll____GGGGeeeettttIIIInnnntttt((((3333TTTTccccllll))))                                              TTTTccccllll____GGGGeeeettttIIIInnnntttt((((3333TTTTccccllll))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      Tcl_GetInt, Tcl_GetDouble, Tcl_GetBoolean - convert from string to
  10.      integer, double, or boolean
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ttttccccllll....hhhh>>>>
  14.  
  15.      int
  16.      TTTTccccllll____GGGGeeeettttIIIInnnntttt(_i_n_t_e_r_p, _s_t_r_i_n_g, _i_n_t_P_t_r)
  17.  
  18.      int
  19.      TTTTccccllll____GGGGeeeettttDDDDoooouuuubbbblllleeee(_i_n_t_e_r_p, _s_t_r_i_n_g, _d_o_u_b_l_e_P_t_r)
  20.  
  21.      int
  22.      TTTTccccllll____GGGGeeeettttBBBBoooooooolllleeeeaaaannnn(_i_n_t_e_r_p, _s_t_r_i_n_g, _b_o_o_l_P_t_r)
  23.  
  24. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  25.      Tcl_Interp   *_i_n_t_e_r_p      (in)      Interpreter to use for error
  26.                                          reporting.
  27.  
  28.      char         *_s_t_r_i_n_g      (in)      Textual value to be converted.
  29.  
  30.      int          *_i_n_t_P_t_r      (out)     Points to place to store integer
  31.                                          value converted from _s_t_r_i_n_g.
  32.  
  33.      double       *_d_o_u_b_l_e_P_t_r   (out)     Points to place to store double-
  34.                                          precision floating-point value
  35.                                          converted from _s_t_r_i_n_g.
  36.  
  37.      int          *_b_o_o_l_P_t_r     (out)     Points to place to store boolean
  38.                                          value (0 or 1) converted from _s_t_r_i_n_g.
  39.  
  40.  
  41. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  42.      These procedures convert from strings to integers or double-precision
  43.      floating-point values or booleans (represented as 0- or 1-valued
  44.      integers).  Each of the procedures takes a _s_t_r_i_n_g argument, converts it
  45.      to an internal form of a particular type, and stores the converted value
  46.      at the location indicated by the procedure's third argument.  If all goes
  47.      well, each of the procedures returns TCL_OK.  If _s_t_r_i_n_g doesn't have the
  48.      proper syntax for the desired type then TCL_ERROR is returned, an error
  49.      message is left in _i_n_t_e_r_p->_r_e_s_u_l_t, and nothing is stored at *_i_n_t_P_t_r or
  50.      *_d_o_u_b_l_e_P_t_r or *_b_o_o_l_P_t_r.
  51.  
  52.      TTTTccccllll____GGGGeeeettttIIIInnnntttt expects _s_t_r_i_n_g to consist of a collection of integer digits,
  53.      optionally signed and optionally preceded by white space.  If the first
  54.      two characters of _s_t_r_i_n_g are ``0x'' then _s_t_r_i_n_g is expected to be in
  55.      hexadecimal form;  otherwise, if the first character of _s_t_r_i_n_g is ``0''
  56.      then _s_t_r_i_n_g is expected to be in octal form;  otherwise, _s_t_r_i_n_g is
  57.      expected to be in decimal form.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TTTTccccllll____GGGGeeeettttIIIInnnntttt((((3333TTTTccccllll))))                                              TTTTccccllll____GGGGeeeettttIIIInnnntttt((((3333TTTTccccllll))))
  71.  
  72.  
  73.  
  74.      TTTTccccllll____GGGGeeeettttDDDDoooouuuubbbblllleeee expects _s_t_r_i_n_g to consist of a floating-point number, which
  75.      is:  white space;  a sign; a sequence of digits;  a decimal point;  a
  76.      sequence of digits;  the letter ``e'';  and a signed decimal exponent.
  77.      Any of the fields may be omitted, except that the digits either before or
  78.      after the decimal point must be present and if the ``e'' is present then
  79.      it must be followed by the exponent number.
  80.  
  81.      TTTTccccllll____GGGGeeeettttBBBBoooooooolllleeeeaaaannnn expects _s_t_r_i_n_g to specify a boolean value.  If _s_t_r_i_n_g is
  82.      any of 0000, ffffaaaallllsssseeee, nnnnoooo, or ooooffffffff, then TTTTccccllll____GGGGeeeettttBBBBoooooooolllleeeeaaaannnn stores a zero value at
  83.      *_b_o_o_l_P_t_r.  If _s_t_r_i_n_g is any of 1111, ttttrrrruuuueeee, yyyyeeeessss, or oooonnnn, then 1 is stored at
  84.      *_b_o_o_l_P_t_r.  Any of these values may be abbreviated, and upper-case
  85.      spellings are also acceptable.
  86.  
  87.  
  88. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  89.      boolean, conversion, double, floating-point, integer
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.